package aip.core.model.information;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import aip.core.model.attachment.Attachment;

/**
 * 发布信息
 * <p>
 * 负责人/principal: Daniel<br/>
 * 修改记录/revision:<br/>
 * 日期:<br/>
 * 修改人:<br/>
 * 修改说明:
 * @author RUN
 * @version $Id: codetemplates.xml 2007 2009-05-08 08:36:14Z shiw $
 */
@Entity
@Table(name = "AIP_ADMIN_INFO")
public class Information implements Serializable
{
    private static final long serialVersionUID = -8782697645667917373L;

    public static final String STATE_PUBLISHED = "PUBLISHED";
    public static final String STATE_DRAFT = "DRAFT";
    public static final String STATE_DEL = "DEL";

    public static final String CATALOG_BULLETIN = "BULLETIN";
    public static final String CATALOG_EDITIONINFO = "EDITIONINFO";
    public static final String CATALOG_HOLDINGS = "HOLDINGS";
    public static final String CATALOG_ARCHIVESLAWS = "ARCHIVESLAWS";

    public static final String DISP_TEXT = "TEXT";
    public static final String DISP_GRAPHTEXT = "GRAPHTEXT";
    public static final Map<String, String> stateMap = new HashMap<String, String>();
    static
    {
        stateMap.put(STATE_PUBLISHED, "发布");
        stateMap.put(STATE_DRAFT, "草稿");
        stateMap.put(STATE_DEL, "删除");
    }

    /** ID */
    private int id;
    /** 状态：草稿、发布 */
    private String state;
    /** 信息分类：公告、编研信息、馆藏资料、档案法规 */
    private int catalog;
    /** 展示方式：文字、图文 */
    private String display;
    /** 信息标题 */
    private String title;
    /** 信息内容 */
    private String content;
    /** 创建人 */
    private String creator;
    /** 创建时间 */
    private Date create;
    /** 发布人 */
    private String publisher;
    /** 发布时间 */
    private Date publishDate;
    /** 最终编辑人 */
    private String lastEditor;
    /** 最终编辑时间 */
    private Date lastEditDate;
    /** 是否置顶显示 */
    private Boolean sticky;
    /** 文章来源 */
    private String source;
    /** 简介 */
    private String describe;
    /** 图文格式的信息关联图片 */
    private List<Attachment> photos;
    /** 前台是否显示发布时间 */
    private boolean showPubDate = true;

    /**
     * @return the id
     */
    @Id
    @Column(name = "ID_")
    public int getId()
    {
        return id;
    }

    /**
     * @param id
     *        the id to set
     */
    public void setId(int id)
    {
        this.id = id;
    }

    /**
     * @return the state
     */
    @Column(name = "STATE_")
    public String getState()
    {
        return state;
    }

    /**
     * @param state
     *        the state to set
     */
    public void setState(String state)
    {
        this.state = state;
    }

    /**
     * @return the catalog
     */
    @Column(name = "CATALOG_")
    public int getCatalog()
    {
        return catalog;
    }

    /**
     * @param catalog
     *        the catalog to set
     */
    public void setCatalog(int catalog)
    {
        this.catalog = catalog;
    }

    /**
     * @return the display
     */
    @Column(name = "DISP_")
    public String getDisplay()
    {
        return display;
    }

    /**
     * @param display
     *        the display to set
     */
    public void setDisplay(String display)
    {
        this.display = display;
    }

    /**
     * @return the title
     */
    @Column(name = "TITLE_")
    public String getTitle()
    {
        return title;
    }

    /**
     * @param title
     *        the title to set
     */
    public void setTitle(String title)
    {
        this.title = title;
    }

    /**
     * @return the content
     */
    @Column(name = "CONTENT_")
    public String getContent()
    {
        return content;
    }

    /**
     * @param content
     *        the content to set
     */
    public void setContent(String content)
    {
        this.content = content;
    }

    /**
     * @return the publisher
     */
    @Column(name = "PUBLISHER_")
    public String getPublisher()
    {
        return publisher;
    }

    /**
     * @param publisher
     *        the publisher to set
     */
    public void setPublisher(String publisher)
    {
        this.publisher = publisher;
    }

    /**
     * @return the publishDate
     */
    @Column(name = "PUB_DATE_")
    public Date getPublishDate()
    {
        return publishDate;
    }

    /**
     * @param publishDate
     *        the publishDate to set
     */
    public void setPublishDate(Date publishDate)
    {
        this.publishDate = publishDate;
    }

    /**
     * @return the lastEditor
     */
    @Column(name = "LAST_EDITOR_")
    public String getLastEditor()
    {
        return lastEditor;
    }

    /**
     * @param lastEditor
     *        the lastEditor to set
     */
    public void setLastEditor(String lastEditor)
    {
        this.lastEditor = lastEditor;
    }

    /**
     * @return the lastEditDate
     */
    @Column(name = "LAST_EDITDATE_")
    public Date getLastEditDate()
    {
        return lastEditDate;
    }

    /**
     * @param lastEditDate
     *        the lastEditDate to set
     */
    public void setLastEditDate(Date lastEditDate)
    {
        this.lastEditDate = lastEditDate;
    }

    /**
     * @return the sticky
     */
    @Column(name = "STICKY_")
    public Boolean getSticky()
    {
        return sticky;
    }

    /**
     * @param sticky
     *        the sticky to set
     */
    public void setSticky(Boolean sticky)
    {
        this.sticky = sticky;
    }

    /**
     * @return the photos
     */
    public List<Attachment> getPhotos()
    {
        return photos;
    }

    /**
     * @param photos
     *        the photos to set
     */
    public void setPhotos(List<Attachment> photos)
    {
        this.photos = photos;
    }

    /**
     * @return the source
     */
    @Column(name = "SOURCE_")
    public String getSource()
    {
        return source;
    }

    /**
     * @param source
     *        the source to set
     */
    public void setSource(String source)
    {
        this.source = source;
    }

    /**
     * @return the creator
     */
    @Column(name = "CREATOR_")
    public String getCreator()
    {
        return creator;
    }

    /**
     * @param creator
     *        the creator to set
     */
    public void setCreator(String creator)
    {
        this.creator = creator;
    }

    /**
     * @return the create
     */
    @Column(name = "CREATE_")
    public Date getCreate()
    {
        return create;
    }

    /**
     * @param create
     *        the create to set
     */
    public void setCreate(Date create)
    {
        this.create = create;
    }

    /**
     * @return the describe
     */
    @Column(name = "DESC_")
    public String getDescribe()
    {
        return describe;
    }

    /**
     * @param describe
     *        the describe to set
     */
    public void setDescribe(String describe)
    {
        this.describe = describe;
    }

    /**
     * @return the showPubDate
     */
    @Column(name = "SHOW_PUB_DATE_")
    public boolean isShowPubDate()
    {
        return showPubDate;
    }

    /**
     * @param showPubDate
     *        the showPubDate to set
     */
    public void setShowPubDate(boolean showPubDate)
    {
        this.showPubDate = showPubDate;
    }
}
